
package com.scs.application.modules.base.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.scs.application.core.model.CommonResult;
import com.scs.application.core.model.PageResult;
import com.scs.application.core.mvc.controller.CrudController;
import com.scs.application.core.mvc.controller.ImAndExAbleController;
import com.scs.application.modules.base.entity.ApplicantCertificateRecord;
import com.scs.application.modules.base.request.ApplicantCertificateRecordQueryRequest;
import com.scs.application.modules.base.service.ApplicantCertificateRecordService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 资格申请资质记录 controller
 */
@AllArgsConstructor
@RestController
@RequestMapping("/base/applicant_certificate_records")
public class ApplicantCertificateRecordController extends CrudController<ApplicantCertificateRecord, String, ApplicantCertificateRecordService> implements ImAndExAbleController<ApplicantCertificateRecordQueryRequest> {


    @GetMapping("/page")
    public PageResult page(ApplicantCertificateRecordQueryRequest request) {
        IPage page = service.page(request);
        return PageResult.ok("查询成功", page.getRecords(), page.getTotal());
    }

    @GetMapping("/list")
    public CommonResult list(ApplicantCertificateRecordQueryRequest request) {
        List<ApplicantCertificateRecord> list = service.list(request);
        return CommonResult.ok("查询成功", list);
    }


}
